package cn.baddonkey.superqueryjavasdk.json;

import java.lang.reflect.Type;

/**
 * 未引入任何依赖时返回该解析器
 */
public class NoneParser implements JsonParser {
    @Override
    public Type getType(Type type) {
        return NoneParser.class;
    }

    private final UnsupportedOperationException E = new UnsupportedOperationException(MESSAGE);
    private static final String MESSAGE = "未引入 JSON 解析依赖";

    @Override
    public <T> T from(String json, Class<T> type) {
        throw E;
    }

    @Override
    public <T> T from(String json, Type type) {
        throw E;
    }

    @Override
    public String to(Object o) {
        throw E;
    }
}
